public class Test {
    public static void main(String[] args) {
        Dog dog1 = new Dog();
        dog1.name = "阿强";
        dog1.gender = "雄";
        dog1.age = 7;
        dog1.barks();
        dog1.wag();
    }
}
class Dog {
    public String name;
    public String gender;
    public int age;

    public void barks() {

        System.out.println(name+":旺旺~");
    }
    public void wag() {

        System.out.println(name+":摇尾巴~");
    }

    public static void main(String[] args) {
//Java一个文件中可以有多个main方法，但是每个类中只能有一个main方法
        Dog dog2 = new Dog();
        dog2.name = "阿珍";
        dog2.age = 5;
        dog2.gender = "雌";
        dog2.barks();//同一时间只能一个main方法运行
    }
}